<?php

namespace common\validate;


class ProducerManage extends BaseValidate
{
    // 验证规则
    protected $rule = [];

    // Fields 验证场景定义
    public function sceneFields()
    {
        return $this;
    }

    // GetSegmentCycleTime 验证场景定义
    public function sceneGetSegmentCycleTime()
    {
        return $this->append('param.filter', 'array|require')
            ->append('param.filter.entity_id', 'require')
            ->append('param.filter.project_id', 'require');
    }

    // GetSegmentTaskList 验证场景定义
    public function sceneGetSegmentTaskList()
    {
        return $this->append('param.filter', 'array|require')
            ->append('param.filter.entity_id', 'require')
            ->append('param.filter.step_category_id', 'require');
    }

    // GetSegmentTaskDetailList 验证场景定义
    public function sceneGetSegmentTaskDetailList()
    {
        return $this->append('param.filter', 'array|require')
            ->append('param.filter.entity_id', 'require')
            ->append('param.filter.step_category_id', 'integer')
            ->append('param.filter.step_id', 'integer');
    }

    // GetSegmentRepairCount 验证场景定义
    public function sceneGetSegmentRepairCount()
    {
        return $this->append('param.filter', 'array|require')
            ->append('param.filter.entity_id', 'require')
            ->append('param.filter.repair_status', 'in:yes,no')
            ->append('param.filter.step_category_id', 'integer')
            ->append('param.filter.step_id', 'integer');
    }

    // GetSegmentRepairDetailList 验证场景定义
    public function sceneGetSegmentRepairDetailList()
    {
        return $this->append('param.filter', 'array|require')
            ->append('param.filter.entity_id', 'require')
            ->append('param.filter.repair_status', 'in:yes,no')
            ->append('param.filter.step_category_id', 'integer')
            ->append('param.filter.step_id', 'integer')
            ->append('param.filter.repair_type', 'require');
    }

    public function sceneTaskList()
    {
        return $this->append('param.filter', 'array|require');
    }

    public function sceneWaitHandleFilter()
    {
        return $this->append('param.department_id', 'require');
    }

    public function sceneTodayAbnormalTask()
    {
        return $this->append('param.project_id', 'require');
    }
}
